<div id="main">
    <div class="container-fluid">
        <div class="page-header">
        	<div class="pull-left">
        		<h1>包房商管理</h1>
        	</div>
        	<div class="pull-right">
        		<ul class="stats">
        			<li class='lightred'>
        				<i class="icon-calendar"></i>
        				<div class="details">
        					<span class="big"></span>
        					<span></span>
        				</div>
        			</li>
        		</ul>
        	</div>
        </div>
        <div class="breadcrumbs">
        	<ul>
        		<li>
        			<a href="javascript:void(0);">后台管理</a>
        			<i class="icon-angle-right"></i>
        		</li>
        		<li>
        			<a href="javascript:void(0);">包房商管理</a>
        			<i class="icon-angle-right"></i>
        		</li>
        		<li>
        			<a href="javascript:void(0);">添加包房商</a>
        		</li>
        	</ul>
        	<div class="close-bread">
        		<a href="#"><i class="icon-remove"></i></a>
        	</div>
        </div>
    
        <div class="row-fluid">
        	<div class="span12">
        		<div class="box box-color box-bordered">
        			<div class="box-title">
        				<h3>
        					<i class="icon-user">
                                添加包房商
                            </i>
        				</h3>
        			</div>
        			<div class="box-content nopadding">
                        <form  class='form-horizontal form-bordered form-validate' action='<?=$this->url("user/editbusiness")?>'  id="login" name="bb" method='post'>
        					<div class="control-group">
        						<label class="control-label">账号</label>
        						<div class="controls">
        							<input type="text" name="userName" id="userName" value="" class="input-xlarge">
                                    &nbsp;&nbsp;&nbsp;初始密码为：123456
                                </div>
        					</div>
        					<div class="control-group">
        						<label class="control-label">公司名称</label>
        						<div class="controls">
        							<input type="text" name="hotelName" id="hotelName" value="" class="input-xlarge">
                                </div>
        					</div>
                            <div class="control-group">
                                <label class="control-label">公司省、市、区 选择</label>
        						<div class="controls">
                                    <select name="province" style="width: 120px;">
                                        <option value="0">请选择</option>
                                        <?
                                        if($province){
                                            foreach($province as $k=>$v){?>
                                                <option value="<?=$v['osiiid']?>"><?=$v['name']?></option>
                                            <?}
                                        }
                                        ?>
                                    </select>
                                    <select name="city" style="width: 120px;">
                                        <option value="0">请选择</option>
                                    </select>
                                    <select name="county" style="width: 120px;">
                                        <option value="0">请选择</option>
                                    </select>
                                </div>
                            </div>
        					<div class="control-group">
        						<label class="control-label">公司地址</label>
        						<div class="controls">
        							<input type="text" name="address" id="address" value="" class="input-xlarge">
                                </div>
        					</div>
        					<div class="control-group">
        						<label class="control-label">联系方式</label>
        						<div class="controls">
        							<input type="text" name="phone" id="phone" value="" class="input-xlarge">
                                </div>
        					</div>
        					<div class="control-group">
        						<label class="control-label">紧急联系人</label>
        						<div class="controls">
        							<input type="text" name="another" id="another" value="" class="input-xlarge">
                                </div>
        					</div>
        					<div class="control-group">
        						<label class="control-label">邮箱</label>
        						<div class="controls">
        							<input type="text" name="email" id="email" value="" class="input-xlarge">
                                </div>
        					</div>
        					<div class="form-actions">
        						<input type="submit" id="edit" class="btn btn-primary show_shadefrist" value="添加" />
                                <input type="reset" class="btn btn-primary" value="重置" />
                                <input type="button" id="frist" class="btn btn-primary" onclick="window.history.go(-1);" value="返回" />
        					</div>
        				</form>
        			</div>
        		</div>
        	</div>
        </div>
    </div>
</div>
<script>
$('select[name="province"]').change(function(){
    var provinceid=$('select[name="province"] option:selected').val();
    onseleted(1,provinceid);
});
$('select[name="city"]').change(function(){
    var cityid=$('select[name="city"] option:selected').val();
    onseleted(2,cityid);
});
function onseleted(type,parentid){
    $.ajax({
        type:'post',
        url:"<?=$this->url('user/get_address')?>",
        data:"type="+type+"&parentid="+parentid,
        dataType:'json',
        success:function (msg){
            if(msg.type==1){
                $('select[name="city"]').html(msg.html);
                $('select[name="county"]').html("<option value='0'>请选择</option>");
            }else if(msg.type==2){
                $('select[name="county"]').html(msg.html);
            }
        },error:function(){
            alert("ajax错误！");
        }
    });
}
</script>